#include<reg51.h>  			//?????
sbit sound=P2^5;  			//?sound????P1.7?
#define f1(a) (65536-a)/256		//????????8?????
#define f2(a) (65536-a)%256    		//????????8?????
unsigned int i=500; 
unsigned int j=0; 
void main(void)
{
	 	EA=1;                  		//????.
  		ET1=1;                		//?????T1??         .
   		TMOD=0x10; 			//TMOD=0001 000B,??T1???1??    	TH1=f1(i);      			//?T1?8????.
   		TL1=f2(i);      			//?T1?8????.
   		TR1=1;                 		//??T1
   		while(1)  
{              				//????
     	i=460; 
      	while(j<2000);
      	j=0;
      	i=360; 
      	while(j<2000);
      	j=0;
    }
 }

void int_T1(void) interrupt 3 using 0	//???T1????
{
    	TR1= 0;                 	//??T1
   	sound=~sound; 			//P1.7????
    	TH1=f1(i);   			//T1??8??????.
    	TL1=f2(i);   			//T1??8??????.
j++;				
    	TR1=1;                 	//?????T1
}
